//
//  AccountModel.m
//  MuRenHe
//
//  Created by mls on 2021/5/13.
//

#import "AccountModel.h"

@implementation AccountModel

ms_codingImplementation

+ (AccountModel *)account
{
    AccountModel *account = [NSKeyedUnarchiver unarchiveObjectWithFile:ms_accountPath];
    return account ?: [[AccountModel alloc] init];
}

+ (void)logout
{
    [NSKeyedArchiver archiveRootObject:[[AccountModel alloc] init]
                                toFile:ms_accountPath];
}

- (BOOL)isLogin
{
    return (self && self.token.length > 0);
}

@end
